package net.xdclass.rbac_shiro.dao;

import net.xdclass.rbac_shiro.domain.Permission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermissionMapper {

    @Select("SELECT p.id   as id," +
            "       p.name as name," +
            "       p.url  as url " +
            "FROM role_permission rp" +
            "         LEFT JOIN permission p ON rp.permission_id = p.id " +
            "WHERE rp.role_id = #{roleId}")
    List<Permission> findPermissionListByRoleId(@Param("roleId") String roleId);

}
